package edu.nuc.ahm.juc.function;

import java.util.function.Supplier;

/*
*  供给型接口
* 没有参数 只有返回值
*
* */
public class Demo04 {
    public static void main(String[] args) {
        Supplier<String> supplier = new Supplier<String>() {
            @Override
            public String get() {
                return "安海蒙";
            }
        };
        System.out.println(supplier.get());

        Supplier<Integer> supplier1 =()->{
            return 666;
        };
        System.out.println(supplier1.get());
    }
}
